<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="keywords" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta content="yes" name="apple-mobile-web-app-capable">     
    <meta content="black" name="apple-mobile-web-app-status-bar-style"> 
    <meta content="telephone=no" name="format-detection">
    <title>{$coupon.name} </title>
    <link rel="icon" type="image/png" href="/public/images/favicon.png">
    <link rel="stylesheet" href="http://wxv2.lppz.com/css/amazeui.min.css">
    <link rel="stylesheet" href="http://wxv2.lppz.com/css/app.css">
    <style>.am-disabled{border:1px solid #999!important;}</style>
</head>
<body class="get-coupon">
<img src="http://wxv2.lppz.com/images/get_cpn_logo.png" height="0" width="0" alt="share" class="share-logo">
<!-- 顶部header -->
<header class="am-header am-header-default lp-topbar">
    <div class="am-header-left am-header-nav">
        <a href="javascript:history.go(-1);" class="">
            <i class="am-header-icon iconfont am-icon-chevron-left"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        <a href="#title-link" class="">领取优惠券</a>
    </h1>
</header>

<section class="lp-content">
    <div class="get-coupon-top">
        <div class="gt-type">{$coupon.name} </div>
        <div class="gt-price"><small>¥</small>{$coupon.money}</div>
        <div class="gt-date">有效日期：{$coupon.use_start_time|date='Y-m-d',###}~{$coupon.use_end_time|date='Y-m-d',###}</div>
    </div>
    <div class="get-coupon-hint">
        <div class="ht-txt">温馨提示：</div>
        <ul class="ht-info">
            <li>限第七感觉官方微信商城使用 单笔订单仅限使用一张~</li>
            <li>
                                          单笔订单只能使用一张。
          	  </li>
			<li>每个ID限领1张</li>
        </ul>
    </div>
    <div class="lp-auto-btn">
        <if condition="$ccount gt 0">
            <button type="button" class="am-btn am-disabled am-radius" >您已经领取了</button>
        <else/>
            <button type="button" class="am-btn am-btn-red am-radius" onclick="send_coupon('{$coupon.id}');" >点击领取</button>
        </if>
    </div>
</section>
<div class="am-modal am-modal-alert" tabindex="-1" id="my-alert">
  <div class="am-modal-dialog">
    <div class="am-modal-hd">温馨提示</div>
    <div class="am-modal-bd">
    </div>
    <div class="am-modal-footer">
      <span class="am-modal-btn">确定</span>
    </div>
  </div>
</div>
<!-- 底部JS -->
<script src="http://wxv2.lppz.com/js/jquery.min.js"></script>
<script src="http://wxv2.lppz.com/js/amazeui.min.js"></script>
<script src="http://wxv2.lppz.com/js/app.js"></script>
<script type="text/javascript">
    function send_coupon(id){
        $.post('{:U("User/ajaxCoupon")}',{id:id},function(res){
            if(res=="1"){
                var text='恭喜您，成功领取一张优惠券！';
            }
             if(res=="2"){
                var text='您已经领取过了哦！';
            }
            $('.am-modal-bd').text(text);
            $('#my-alert').modal();
        })
    }
</script>


</body>
</html>